<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>轮回之牢: D:/Code/cProgram/CPP/Qt/TeamCurriculumDesign/Utils/OpenGL/Texture.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">轮回之牢<span id="projectnumber">&#160;0.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_80876d1476b72d92a9650b7ee3516e4c.html">TeamCurriculumDesign</a></li><li class="navelem"><a class="el" href="dir_3e04d676d81597a8e4919b52d418897c.html">Utils</a></li><li class="navelem"><a class="el" href="dir_e9101639cc84536b77ac5412da484112.html">OpenGL</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">Texture.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#ifndef TEXTURETOOL_H</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="preprocessor">#define TEXTURETOOL_H</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="preprocessor">#include &lt;QOpenGLFunctions&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#include &lt;QOpenGLVertexArrayObject&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#include &lt;QOpenGLShaderProgram&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#include &lt;QOpenGLBuffer&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#include &lt;qrgb.h&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &quot;../Math/Point.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="class_texture.html">   13</a></span><span class="keyword">class </span><a class="code hl_class" href="class_texture.html">Texture</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span>    <span class="keyword">enum</span> TextTextureStartType {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span>        CENTER, LOWER_LEFT,</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>    };</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>    <span class="keyword">static</span> <a class="code hl_class" href="class_texture.html">Texture</a> &amp;GetInstance();</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>    <span class="keywordtype">void</span> drawImage(<span class="keyword">const</span> QString &amp;img_path, <span class="keyword">const</span> <a class="code hl_class" href="class_point.html">Point</a> &amp;start_pos, <span class="keywordtype">float</span> width, <span class="keywordtype">float</span> height, <span class="keywordtype">float</span> window_width,</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>                   <span class="keywordtype">float</span> window_height, <span class="keywordtype">float</span> img_width, <span class="keywordtype">float</span> img_height, <span class="keywordtype">float</span> rotation_z = 0, <span class="keywordtype">float</span> rotation_y = 0,</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>                   <span class="keywordtype">float</span> rotation_x = 0);</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>    <span class="keywordtype">void</span> drawImage(<span class="keyword">const</span> QPair&lt;QString, QImage *&gt; &amp;image, <span class="keyword">const</span> <a class="code hl_class" href="class_point.html">Point</a> &amp;start_pos, <span class="keywordtype">float</span> width, <span class="keywordtype">float</span> height,</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>                   <span class="keywordtype">float</span> window_width, <span class="keywordtype">float</span> window_height, <span class="keywordtype">float</span> img_width, <span class="keywordtype">float</span> img_height, <span class="keywordtype">float</span> rotation_z = 0,</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>                   <span class="keywordtype">float</span> rotation_y = 0, <span class="keywordtype">float</span> rotation_x = 0);</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span> </div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_texture.html#a02a1ce144c1214f09623142bc9157b57">drawText</a>(<span class="keyword">const</span> QString &amp;text, <span class="keyword">const</span> QFont &amp;font, <span class="keyword">const</span> QColor &amp;fontColor, <span class="keyword">const</span> <a class="code hl_class" href="class_point.html">Point</a> &amp;start_pos,</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>                  TextTextureStartType start_type, <span class="keywordtype">float</span> window_width, <span class="keywordtype">float</span> window_height,</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>                  <span class="keywordtype">float</span> rotation_z = 0, <span class="keywordtype">float</span> rotation_y = 0, <span class="keywordtype">float</span> rotation_x = 0);</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_texture.html#aad841dc48560556f5995d731d2b1924a">solidFill</a>(<span class="keyword">const</span> QRgb &amp;rgb, <span class="keyword">const</span> <a class="code hl_class" href="class_point.html">Point</a> &amp;start_pos, <span class="keywordtype">float</span> width, <span class="keywordtype">float</span> height, <span class="keywordtype">float</span> window_width,</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>                   <span class="keywordtype">float</span> window_height, <span class="keywordtype">float</span> rotation_z = 0, <span class="keywordtype">float</span> rotation_y = 0, <span class="keywordtype">float</span> rotation_x = 0);</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span> </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>    <a class="code hl_class" href="class_texture.html">Texture</a>();</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>    <a class="code hl_class" href="class_texture.html">Texture</a>(<span class="keyword">const</span> <a class="code hl_class" href="class_texture.html">Texture</a> &amp;other);</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span> </div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>    QOpenGLVertexArrayObject VAO;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>    QOpenGLBuffer VBO;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>    QOpenGLShaderProgram program;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span> </div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>    <span class="keywordtype">void</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span>    drawTexture(<span class="keyword">const</span> GLuint &amp;textureId, <span class="keyword">const</span> QRectF &amp;geometry, <span class="keywordtype">float</span> x_scale, <span class="keywordtype">float</span> y_scale, <span class="keywordtype">float</span> rotation_z = 0,</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>                <span class="keywordtype">float</span> rotation_y = 0, <span class="keywordtype">float</span> rotation_x = 0);</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span> </div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>    <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">float</span> convertToGLPos(<span class="keywordtype">float</span> pos_1, <span class="keywordtype">float</span> window_1);</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span> </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span> </div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>    <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">float</span> convertToGLLength(<span class="keywordtype">float</span> length, <span class="keywordtype">float</span> window_length);</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>};</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span> </div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span><span class="preprocessor">#define textureInstance (Texture::GetInstance())</span></div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span> </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span><span class="preprocessor">#endif </span><span class="comment">// TEXTURETOOL_H</span></div>
<div class="ttc" id="aclass_point_html"><div class="ttname"><a href="class_point.html">Point</a></div><div class="ttdoc">二维点</div><div class="ttdef"><b>Definition:</b> Point.h:18</div></div>
<div class="ttc" id="aclass_texture_html"><div class="ttname"><a href="class_texture.html">Texture</a></div><div class="ttdoc">纹理管理器</div><div class="ttdef"><b>Definition:</b> Texture.h:13</div></div>
<div class="ttc" id="aclass_texture_html_a02a1ce144c1214f09623142bc9157b57"><div class="ttname"><a href="class_texture.html#a02a1ce144c1214f09623142bc9157b57">Texture::drawText</a></div><div class="ttdeci">void drawText(const QString &amp;text, const QFont &amp;font, const QColor &amp;fontColor, const Point &amp;start_pos, TextTextureStartType start_type, float window_width, float window_height, float rotation_z=0, float rotation_y=0, float rotation_x=0)</div><div class="ttdoc">绘制文字</div><div class="ttdef"><b>Definition:</b> Texture.cpp:144</div></div>
<div class="ttc" id="aclass_texture_html_aad841dc48560556f5995d731d2b1924a"><div class="ttname"><a href="class_texture.html#aad841dc48560556f5995d731d2b1924a">Texture::solidFill</a></div><div class="ttdeci">void solidFill(const QRgb &amp;rgb, const Point &amp;start_pos, float width, float height, float window_width, float window_height, float rotation_z=0, float rotation_y=0, float rotation_x=0)</div><div class="ttdoc">绘制纯色区域</div><div class="ttdef"><b>Definition:</b> Texture.cpp:177</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>
